using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MiniAnimation
{

    public enum MiniCurve
    {
        None,
        Linear,

        InBack,
        OutBack,
        InOutBack,

        InQuad,
        OutQuad,
        InOutQuad,

        InCubic,
        OutCubic,
        InOutCubic,

        InQuart,
        OutQuart,
        InOutQuart,

        InQuint,
        OutQuint,
        InOutQuint,

        InSine,
        OutSine,
        InOutSine,

        InExpo,
        OutExpo,
        InOutExpo,

        InCirc,
        OutCirc,
        InOutCirc,

        InBounce,
        OutBounce,
        InOutBounce,

        InElastic,
        OutElastic,
        InOutElastic,
    }
    /// <summary>
    /// 缓动函数集
    /// </summary>
    public static class EaseCurve
    {

        public static double Evalute(MiniCurve ease_type, float x)
        {
            switch (ease_type)
            {

                case MiniCurve.Linear:
                    return x;
                case MiniCurve.InBack:
                    return AnimateBase.Back(x, LEaseMode.EaseIn);
                case MiniCurve.InBounce:
                    return AnimateBase.Bounce(x, LEaseMode.EaseIn);
                case MiniCurve.InCirc:
                    return AnimateBase.Circle(x, LEaseMode.EaseIn);
                case MiniCurve.InCubic:
                    return AnimateBase.Cubic(x, LEaseMode.EaseIn);
                case MiniCurve.InElastic:
                    return AnimateBase.Elastic(x, LEaseMode.EaseIn);
                case MiniCurve.InExpo:
                    return AnimateBase.Exponential(x, LEaseMode.EaseIn);
                case MiniCurve.InQuad:
                    return AnimateBase.Quadratic(x, LEaseMode.EaseIn);
                case MiniCurve.InQuart:
                    return AnimateBase.Quartic(x, LEaseMode.EaseIn);
                case MiniCurve.InQuint:
                    return AnimateBase.Quintic(x, LEaseMode.EaseIn);
                case MiniCurve.InSine:
                    return AnimateBase.Sine(x, LEaseMode.EaseIn);



                case MiniCurve.InOutBack:
                    return AnimateBase.Back(x, LEaseMode.EaseInOut);
                case MiniCurve.InOutBounce:
                    return AnimateBase.Bounce(x, LEaseMode.EaseInOut);
                case MiniCurve.InOutCirc:
                    return AnimateBase.Circle(x, LEaseMode.EaseInOut);
                case MiniCurve.InOutCubic:
                    return AnimateBase.Cubic(x, LEaseMode.EaseInOut);
                case MiniCurve.InOutElastic:
                    return AnimateBase.Elastic(x, LEaseMode.EaseInOut);
                case MiniCurve.InOutExpo:
                    return AnimateBase.Exponential(x, LEaseMode.EaseInOut);
                case MiniCurve.InOutQuad:
                    return AnimateBase.Quadratic(x, LEaseMode.EaseInOut);
                case MiniCurve.InOutQuart:
                    return AnimateBase.Quartic(x, LEaseMode.EaseInOut);
                case MiniCurve.InOutQuint:
                    return AnimateBase.Quintic(x, LEaseMode.EaseInOut);
                case MiniCurve.InOutSine:
                    return AnimateBase.Sine(x, LEaseMode.EaseInOut);

                case MiniCurve.OutBack:
                    return AnimateBase.Back(x, LEaseMode.EaseOut);
                case MiniCurve.OutBounce:
                    return AnimateBase.Bounce(x, LEaseMode.EaseOut);
                case MiniCurve.OutCirc:
                    return AnimateBase.Circle(x, LEaseMode.EaseOut);
                case MiniCurve.OutCubic:
                    return AnimateBase.Cubic(x, LEaseMode.EaseOut);
                case MiniCurve.OutElastic:
                    return AnimateBase.Elastic(x, LEaseMode.EaseOut);
                case MiniCurve.OutExpo:
                    return AnimateBase.Exponential(x, LEaseMode.EaseOut);
                case MiniCurve.OutQuad:
                    return AnimateBase.Quadratic(x, LEaseMode.EaseOut);
                case MiniCurve.OutQuart:
                    return AnimateBase.Quartic(x, LEaseMode.EaseOut);
                case MiniCurve.OutQuint:
                    return AnimateBase.Quintic(x, LEaseMode.EaseOut);
                case MiniCurve.OutSine:
                    return AnimateBase.Sine(x, LEaseMode.EaseOut);
                default:
                    return x;
            }
        }
    }
}